import SettingSecurity from './SettingSecurity';
import SettingInfo from './SettingInfo';
import SettingAccount from './SettingAccount';
import SettingMessageRent from './SettingMessageRent';
import SettingIdentity from './SettingIdentity';
import SettingChangePsw from './SettingChangePsw';
import SettingMessageContract from './SettingMessageContract';
import SettingMessageOverdue from './SettingMessageOverdue';
import SettingMessageSystem from './SettingMessageSystem';
import authCheck from '@/tool/authCheck';
import adminType from '@/tool/adminType';
import adminAuthType from '@/tool/adminAuthType';

const _path = [
    { path: '', component: SettingSecurity },
    { path: '/基本资料', component: SettingInfo },
    { path: '/账号设置', component: SettingAccount },
    { path: '/消息管理', component: SettingMessageRent },
    { path: '/消息管理/合同', component: SettingMessageContract },
    { path: '/消息管理/逾期', component: SettingMessageOverdue },
    { path: '/消息管理/系统', component: SettingMessageSystem },
    { path: '/实名认证', component: SettingIdentity },
    { path: '/修改密码', component: SettingChangePsw }
];

export const path = () => {
    if (!authCheck('*', '设置')) return [];
    if (adminType() == 1 && adminAuthType() == 1) return _path;
    return (
        [
            { path: '', component: SettingSecurity },
            { path: '/基本资料', component: SettingInfo },
            { path: '/消息管理', component: SettingMessageRent },
            { path: '/消息管理/合同', component: SettingMessageContract },
            { path: '/消息管理/逾期', component: SettingMessageOverdue },
            { path: '/消息管理/系统', component: SettingMessageSystem },
            { path: '/修改密码', component: SettingChangePsw }
        ]
    );
};

export const pathName = '设置';